<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAssetsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('assets', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedDecimal('amount',30,0)->comment('金额');
            $table->unsignedInteger('trade_queue_id');
            $table->unsignedBigInteger('created_at')->comment('未匹配金额为 0 的时间');

            $table->unsignedBigInteger('updated_at');

            $table->foreign('trade_queue_id')->references('id')->on('trade_queues');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('assets');
    }
}
